From 864218b307e0017acebfbc71ecea7d5e2391a0c6 Mon Sep 17 00:00:00 2001 From: justbur Date: Tue, 3 Nov 2015 20:03:29 -0500 Subject: [PATCH] Add example of adding Unicode replacements in README Thanks @epitzer for the suggestion. https://github.com/justbur/emacs-which-key/issues/52 --- README.org | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index a9a70d8c3f2..8e56c9dbcf6 100644 --- a/README.org +++ b/README.org @@ -277,11 +277,16 @@ match. The replacements do not need to use regexp and can be as simple as ("left" . "lft") #+END_SRC -You can add this element to the key list with (there are no helper functions for -these alists) +Here is an example of using key replacement to include Unicode characters in the +results. Unfortunately, using Unicode characters may upset the alignment of the +which-key buffer, because Unicode characters can have different widths even in a +monospace font and alignment is based on character width. #+BEGIN_SRC Emacs-lisp -(add-to-list 'which-key-key-replacement-alist '("left" . "lft")) +(add-to-list 'which-key-key-replacement-alist '("TAB" . "↹")) +(add-to-list 'which-key-key-replacement-alist '("RET" . "⏎")) +(add-to-list 'which-key-key-replacement-alist '("DEL" . "⇤")) +(add-to-list 'which-key-key-replacement-alist '("SPC" . "␣")) #+END_SRC *** Sorting Options -- 2.30.2